<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<title>系统风险评估</title>
<%@include file="/WEB-INF/base.jspf"%>
<style type="text/css">
.body_wrapper {
	height: 100%;
	width: 100%;
	box-sizing: border-box;
	padding: 0px 20px;
}

.wrapper_buttons {
	position: relative;
}

.shezhileiContent {
	width: 160px;
	height: 150px;
	border: 1px solid #9c8f8f;
	border-radius: 5px;
	box-sizing: border-box;
	padding: 13px;
	position: absolute;
	right: 0px;
	top: 36px;
	z-index: 999;
	background: #fff;
}

.shezhileiContent li {
	margin-bottom: 10px;
}

.shezhileiContent li span {
	margin-left: 6px;
}

.wrapper_buttons input {
	height: 32px;
	width: 174px;
	margin-left: 10px;
	margin-top: 10px;
}

.wrapper_buttons button {
	margin-left: 10px;
}

#table_id_example_paginate {
	margin-right: 100px;
}

.class-input-pageNumber {
	width: 40px;
	height: 23px;
	position: absolute;
	right: 65px;
	top: 12px;
}

.class-span-searchBtn {
	height: 24px;
	width: 36px;
	font-size: 14px;
	text-algin: center;
	line-height: 25px;
	padding: 0 !important;
	position: absolute;
	right: 29px;
	top: 12px;
}

.dataTables_length {
	margin-top: 12px;
	margin-left: 50px;
}

.tableSearch {
	position: relative;
}

table th, table tr, table td {
	text-align: center;
	vertical-align: middle;
}

.layui-btn {
	height: 32px !important;
	line-height: 32px !important;
	margin-top: 10px;
}

.body_wrapper {
	height: 100%;
	width: 100%;
	box-sizing: border-box;
	padding: 0px 20px;
}

.wrapper_buttons {
	position: relative;
}

.wrapper_buttons input {
	height: 32px;
	width: 174px;
	margin-left: 10px;
}

table th, table tr, table td {
	text-align: center;
	vertical-align: middle;
}
</style>
</head>
<body>
	<div class="body_wrapper">
		<div class="wrapper_buttons" style="display: flex; margin-top: 20px;">
			<input type="text" name="" id="obj-date1" placeholder="开始时间" /> <input
				type="text" name="" id="obj-name" value="" class="form-control"
				placeholder="单用户查询" />
			<button type="button" class="layui-btn layui-btn-radius"
				id="btn-searchTable">查询</button>
			<button type="button" class="layui-btn layui-btn-radius"
				id="btn-resetTable">重置</button>
			<br />
		</div>
		<div class="wrapper_buttons"
			style="display: flex; margin-bottom: 20px;">
			<input type="text" name="" id="obj-date2" placeholder="结束时间" />
		</div>
		<table id="table_id_example"
			class="class-tableDataTable class-table-needClick display table table-striped table-bordered table-hover">
			<thead>
				<tr>
					<th>用户账号</th>
					<th>用户类型</th>
					<th>注册时间</th>
					<th>最后登录时间</th>
					<th>未登录时间</th>
					<th>注册IP</th>
					<th>最后登录IP</th>
				</tr>
			</thead>
			<tbody>
			</tbody>
		</table>
	</div>
	<script>
	layui.use('laydate', function() {
		var laydate = layui.laydate;
		laydate.render({
			elem : '#obj-date1', 
		    value: new Date(),
		    max: new Date()+1
		});
		laydate.render({
			elem : '#obj-date2', 
		    value: new Date(),
		    max: new Date()+1
		});
	});
	function  dataTable01(){
			$("#table_id_example").DataTable({
		      // "bPaginate": true,
		      "bLengthChange": true,      
		      "bSort": false,
		      // "bInfo": true,
		      "bAutoWidth": false,
//		         "bServerSide":true,
		      'aLengthMenu':[5, 10, 20],
		       "searching": true, 
		       "dom": "t<'tableinfo'i<'tableSearch'p>l>",
		       "language": {//语言设置  
		            "lengthMenu": "每页显示 _MENU_ 条记录",     
		            "zeroRecords": "没有检索到数据",     
		            "sInfo": "当前显示 _START_ 到 _END_ 条，共 _TOTAL_ 条记录",     
		            "info": "没有数据",     
		            "oPaginate": {     
		                "sFirst": "首页",     
		                "sPrevious": "前一页",     
		                "sNext": "后一页",     
		                "sLast": "尾页"    
		          	},
		            "search":"",
		            "searchPlaceholder": "请输入关键字",
		            "infoFiltered":   "(从  _MAX_ 记录中搜索出结果)",
		            "infoEmpty":      "没有找到匹配的信息",
		         },
		         "columns": [
		                     { "data": "name" },
		                     { "data": "nicheng" },
		                     { "data": "registerTime" },
		                     { "data": "lastTime" },
		                     { "data": "notTime" },
		                     { "data": "registerIp" },
		                     { "data": "lastIp" }
		                 ],
			      "ajax": {
		    	  	  "type": 'post',
		    	      "url":"/bbgl/findRiskAssess.do", 
			    	  "data": function (result) {
			    	        result.startTime = $('#obj-date1').val();
			    	        result.endTime = $('#obj-date2').val();
			    	        result.userName = $('#obj-name').val();
			      }
		       },
		    })
		}
		 dataTable01();
		 insertSearchBtn(); 
			
	 	$("#btn-searchTable").on("click", function(e) {
			var table = $("#table_id_example").DataTable();			
			table.ajax.reload();
		})	
		
		$("#btn-resetTable").on("click", function(e) {
			$('#obj-name').val('');
			$('#obj-date1').val('');
			$('#obj-date2').val('');
			var table = $("#table_id_example").DataTable();
			table.ajax.reload();
		})	 
</script>
</body>
</html>